1. Field of the Invention
The present invention generally relates to a system for diagnosing program failure, and, in particular, to a stack-based callback scheme for diagnostic data generation.
2. Description of the Related Art
Software programs often fail by “crashing” or reaching error conditions that cause them to terminate. In order to improve product quality, it is important to diagnose the reasons for failure.
Operating systems often generate crash data for software programs, wherein the crash data can be analyzed in an attempt to diagnose the reasons for failure. For example, MICROSOFT WINDOWS operating systems create a “full dump” or “minidump” file, and UNIX or LINUX operating systems create a “core dump” file, when a program terminates due to unhandled error conditions.
It is well known for software program vendors to provide users with a set of tools for capturing and analyzing program crash data. In their simplest form, these tools comprise an error reporting mechanism that presents the users with an alert message that notifies them when a failure occurs and provides an opportunity to forward crash data to the vendor for further analysis. The vendor can then use the forwarded crash data to troubleshoot problems, ultimately leading to more robust and crash-resistant programs.
Often, the programs are sufficiently complex, so that even though the point of failure is known, the amount of information that captures the program's full state in the crash data is unmanageably large, e.g., 100's of Megabytes. Even then, the crash data may not contain all the information needed to diagnose the problem. For example, some of the information needed to diagnose the problem may be external to the program, e.g., stored in files. Also, the information needed to diagnose the problem is often only a small fraction of the crash data, e.g., 10's of Kilobytes. Although there are sometimes options to generate subsets of the program's full state in the crash data, such subsets are almost certain to miss critical diagnostic information.
The key point is that the crash data generated by an operating system is usually directed at a generic program, since the operating system does not know about specific internal logic and critical state data pertaining to the program.
Thus, there is a need in the art for a mechanism where the information to help diagnose the problem can be intelligently supplied by the program itself. Specifically, there is a need in the art for a mechanism that uses the program's knowledge of what information is relevant at the point of failure when providing the crash data to help diagnose the program. The present invention satisfies that need.